Skip to content

Comments

fix: correctly cache visited nodes when checking schemas#4

Merged
DemonHa merged 1 commit intomasterfrom
redis/fix-circular-detection-cache
Jan 6, 2026
Merged

fix: correctly cache visited nodes when checking schemas#4
DemonHa merged 1 commit intomasterfrom
redis/fix-circular-detection-cache

Conversation

@DemonHa
Copy link

@DemonHa DemonHa commented Jan 6, 2026

The current circular dependency detection logic has a flaw.

We currently add the current node to the cache and remove it once the traversal of that subtree finishes, with the intention of validating circular references independently across different subtrees. However, this approach breaks when sibling nodes reference the same target.

In such cases, the cache gets invalidated too early, which can lead to incorrect state tracking and results in deep, unintended recursive traversal.

Copy link
Member

@hanspagel hanspagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DemonHa knows what he does

@DemonHa DemonHa merged commit 2bedc2c into master Jan 6, 2026
18 checks passed
@DemonHa DemonHa mentioned this pull request Jan 7, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants